<template>
	<view class="evaluateList-wrap">
		<view class="doctorInfo-evaluate" v-if="commentList.length > 0">
			<u-title :value="'患者评价（' + commentList.length + '）'"></u-title>
			<view class="section7" v-for="(item, index) in commentList" :key="index">
				<view class="box7">
					<view class="box7-txt">{{ item.patientName }}</view>
					<uni-rate readonly :value="item.star" />
				</view>
				<text lines="1" decode="true" class="word11">{{ item.content }}</text>
				<text lines="1" decode="true" class="txt2">{{ item.createdTime }}</text>
			</view>
			
		</view>
		<u-empty-state v-if="commentList.length == 0" value="暂无相关评价"></u-empty-state>
	</view>
</template> 

<script>
import uniRate from '@/components/uni/uni-rate/uni-rate.vue';
import uTitle from '@/components/u-title/u-title.vue';
import uEmptyState from '@/components/u-empty-state/u-empty-state.vue';
export default {
	components: {
		uTitle,
		uniRate,
		uEmptyState
	},
	data() {
		return {
			commentList: []
		};
	},
	onLoad(option) {},
	onShow() {
		this.myCommentList();
	},
	methods: {
		//医师的评论列表
		myCommentList() {
			this.$api
				.myCommentList({
					params: {
						pageNo: 1,
						pageSize: 999
					}
				})
				.then(res => {
					if (res.code == 200) {
						this.commentList = res.result.records;
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none'
						});
					}
				});
		}
	}
};
</script>

<style lang="less">
@import './evaluateList.less';
</style>
